function findMostWord(article = "") {
  if (!article) return;
  article = article.trim().toLocaleLowerCase();
  let wordList = article.match(/[a-z]+/g),
    visited = {},
    maxWord = "",
    maxNum = 0;
  article = " " + wordList.join("  ") + " ";

  wordList.forEach((word) => {
    if (!visited[word]) {
      visited[word] = true;
      const matchWord = new RegExp(" " + word + " ", "g");
      const num = article.match(matchWord).length;
      if (num > maxNum) {
        maxNum = num;
        maxWord = word;
      }
    }
  });

  return maxWord + " " + maxNum;
}

const article =
  "A substance that cannot be broken down into simpler substances by chemical means. An element is composed of atoms that have the same atomic number; that is, each atom has the same number of protons in its nucleus as all other atoms of that element. Today 112 elements are known, of which 92 are known to occur in nature, while the remaining 20 have only been made with particle accelerators.";
console.log(findMostWord(article));
